#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(ui->pushButton,&QPushButton::clicked,this,&Widget::handleclicked);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handleclicked()
{
    if(ui->pushButton->text()==QString("666")) {
        ui->pushButton->setText("is me");
    } else {
        ui->pushButton->setText("666");
    }
}

